import request from '@/utils/request'

export default {

  // 条件分页查询系统公告
  getList(current, size, data) {
    return request({
      url: `/system/announcement/admin/search/${current}/${size}`,
      method: 'post',
      data
    })
  },
  // 新增系统公告
  add(data) {
    return request({
      url: `/system/announcement`,
      method: 'post',
      data
    })
  },
  // 根据ID查询详情
  getById(id) {
    return request({
      url: `/system/announcement/${id}`,
      method: 'get'
    })
  },
  // 根据ID编辑
  update(data) {
    return request({
      url: `/system/announcement`,
      method: 'put',
      data
    })
  },
  // 根据ID删除
  deleteById(id) {
    return request({
      url: `/system/announcement/${id}`,
      method: 'delete'
    })
  },
  // 公告启用或停用
  updateStatusById(id, status) {
    return request({
      url: `/system/announcement/update/status/${id}/${status}`,
      method: 'get'
    })
  }
}
